package com.atguigu.mymvc.dto;

import java.util.List;

//分页组件类
public class PageInfo<T> {
    private List<T> list ;
    private Integer pageNo = 1;
    private Integer pageSize = 5 ;
    private Integer recordCount = 0;
    private Integer pageCount = 0;

    public PageInfo(){}

    public PageInfo(List<T> list, Integer pageNo, Integer recordCount) {
        this.list = list;
        this.pageNo = pageNo;
        this.recordCount = recordCount;
        this.pageCount = (recordCount+pageSize-1)/pageSize;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public Integer getPageNo() {
        return pageNo;
    }

    public void setPageNo(Integer pageNo) {
        this.pageNo = pageNo;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getRecordCount() {
        return recordCount;
    }

    public void setRecordCount(Integer recordCount) {
        this.recordCount = recordCount;
    }

    public Integer getPageCount() {
        return pageCount;
    }

    public void setPageCount(Integer pageCount) {
        this.pageCount = pageCount;
    }
}
